<template>
  <el-dialog
    title='comment-on'
    size="large"
    class="login-form "
    width="440px"
    :close-on-click-modal="false"
    :destroy-on-close="true"
    :lock-scroll="false"
    :visible="visible"
    :before-close="handleClose">
    <div class="second_block">
      <br>
      <div style="font-size: 20px;text-align: center;color: white;">{{script_1}}</div>
      <br>
<!--      <div style="font-size: 15px;text-align: center;color: white;">{{script_2}}</div>-->
      <br>
      <el-rate
        v-model="form.rate"
        style="font-size: 20px;text-align: center;color: white;">
      </el-rate>
      <br>
<!--      <div style="font-size: 15px;text-align: center;color: white;">{{script_3}}</div>-->
      <br>
<!--      <div style="font-size: 20px;text-align: center;color: white;">{{script_2}}</div>-->
      <br>
      <div style="text-align: center">
        <el-button type="warning" @click="doBackGiftSelection">PREV STEP</el-button>
        &nbsp;&nbsp;
        <el-button type="primary" @click="doConfirmPage">NEXT STEP</el-button>
      </div>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "comment-on",
  props: {
    // 弹窗是否打开
    visible: Boolean,
    data: Object,
  },
  data() {
    return {
      // 表单数据
      form: Object.assign({}, this.data),
      // 表单验证规则
      rules: {
      },
      texts:['差评','一般','还行','好评','强烈好评'],
      // 提交状态
      loading: false,
      // 是否是修改
      isUpdate: false,
      script_1:'',
      script_2:'',
      // script_3:'',
      // script_4:'',
    };
  },
  methods : {
    //关闭页面
    handleClose(done) {
      done();
      this.$emit('handleClose');
    },
    setBuyerConfig(data)
    {
      this.script_1 = data.comment_page_script.script_1;
      this.script_2 = data.comment_page_script.script_2;
      // this.script_3 = data.comment_page_script.script_3;
      // this.script_4 = data.comment_page_script.script_4;
    },
    //返回上一级
    doBackGiftSelection()
    {
      this.$emit('doBackGiftSelection','');
    },
    //调整确认留评页 或 确认礼品页
    doConfirmPage()
    {
      //判断是否有选择礼品
      if (!this.form.rate){
        this.$message({type:'warning',message:'请进行评分',offset:160});
      }else{
        this.$emit('getCommonOn',this.form);
      }

    }
  }
}
</script>

<style scoped>

::v-deep .el-rate__icon{
  font-size: 30px;
}

</style>
